/**
 * <p>功能:系统管理模块-权限管理-组织机构管理 <p>
 * @extends Wys.basic.BaseView
 * @author wys
 */
Ext.define('Jason.view.protal.module.systemManager.right.organize.MainView', {
    extend: 'Ext.container.Container',
    xtype: 'systemManager_organize_usersView',
    requires: [
        'Ext.panel.Panel',
        'Wys.form.field.UploadField',
        'Wys.form.field.SearchField',
        'Wys.combobox.ComboTree',
        'Wys.utils.Config',
        'Wys.form.BaseWindow',
        'Ext.button.Button',
        'Jason.store.protal.module.systemManager.right.organize.TreeStore',
        'Jason.store.protal.module.systemManager.sources.area.TreeStore',
        'Jason.view.protal.module.systemManager.right.organize.MainCtrl',
        'Jason.store.protal.module.systemManager.right.organize.Store',
        'Jason.view.protal.module.systemManager.right.organize.MainViewModel'
    ],
    controller: 'rightOrganizeCtrl',
    viewModel: { type: 'organize_MainViewModel' },
    layout: {
        type: 'hbox',
        align: 'stretch'
    },
    items: [{
        cls: 'faq-left-sidebar shadow-panel',
        ui: 'light',
        border: true,
        itemId:'areaLeftView',
        xtype: 'treepanel',
        title: '行政区划',
        ui: 'light',
        reserveScrollbar: true,
        useArrows: true,
        rootVisible: false,
        multiSelect: true,
        singleExpand: true,
        bind:'{areaTreeStore}',
        listeners: {
            itemclick: 'onTreeNodeClick'
        },
        iconCls: 'x-fa fa-sitemap',
        responsiveConfig: {
            'width < 1000': {
                width: 0,
                visible: false
            },
            'width >= 1000 && width < 1600': {
                width: 250,
                visible: true
            },
            'width >= 1600': {
                width: 300,
                visible: true
            }
        },
        plugins: [
            {
                ptype: 'responsive'
            }
        ]
    },{
            cls: 'faq-left-sidebar shadow-panel',
            ui: 'light', flex: 1,margin: '0 0 0 6',
            border: true,
            xtype: 'treepanel',itemId:'orgsView',
            reserveScrollbar: true,
            useArrows: true,
            rootVisible: false,
            multiSelect: true,
            singleExpand: true,
            columns: [{
                xtype: 'treecolumn',
                text: '组织机构名称',
                dataIndex: 'deptname',
                flex: 4,
                sortable: true
            },
            { text: '组织机构代码',dataIndex:'deptCode'},
            { text: '电话',flex:1,dataIndex:'deptTel'},
            { text: '传真',flex:1,dataIndex:'deptFax'},
            { text: '地址',flex:2,dataIndex:'deptAddress'},
            // { text: '备注', dataIndex: 'deptremarks', flex: 4 },
            { text: '创建日期', dataIndex: 'createDate', width: 135, xtype: 'datecolumn', format: 'Y-m-d H:i' },
            {
                xtype: 'command',
                text: '操作',
                align: 'center',
                width: 140,
                commands: [
                    { command: "modify", text: '编辑', tooltip: { text: '编辑' }, cls: 'radiusBtn a-text-success' },
                    { command: "add", text: "添加", tooltip: { text: '添加' }, cls: 'radiusBtn a-text-success' },
                    { command: "remove", text: "删除", tooltip: { text: '删除' }, cls: 'radiusBtn a-text-danger' }
                ],
                listeners: {
                    command: 'onGridCommand'
                }
            }
            ],
            bind: '{leftMenuTreeStore}',
            dockedItems: [{
                xtype: 'toolbar',
                dock: 'top',
                items: [{
                    xtype: 'gridsearchfield', paramName: 'keyWord'
                }, {
                    xtype: 'segmentedbutton',
                    items: [{
                        xtype: 'newbutton',
                        rightCode: 'DEPTMANAGER'
                    }]
                }, '->', {
                    iconCls: 'fa fa-refresh',
                    tooltip: '点击刷新数据结构',
                    listeners: {
                        click: 'refreshLeftMenuTree'
                    }
                }]
            }/*,{
                xtype: 'pagingtoolbar',
                bind: '{leftMenuTreeStore}',
                enabledMoreOpt: true,
                dock: 'bottom'
            }*/]
        }
    ]
});